using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;

public class AtlasManager : MonoBehaviour
{
    [SerializeField]
    private GameObject prefab;
    [SerializeField]
    private Transform content;

    private ItemDataSO itemDataSO;

    private void Awake() {
        itemDataSO = Resources.Load<ItemDataSO>("Data/ItemData");
    }

    private void Start() {
        foreach(var data in itemDataSO.dataList) {
            GameObject itemPrefab = Instantiate(prefab, content);
            Item item = itemPrefab.GetComponent<Item>();
            Debug.Log($"{data.level}, {data.icon}, {data.bg}, {data.curPercent}, {data.maxPercent}");
            item.UpdateInfo(data.level, data.icon, data.bg, data.curPercent, data.maxPercent);
        }
    }
}
